
import { Column, Model, Table, ForeignKey } from 'sequelize-typescript';
import { DataTypes } from "sequelize";
import { Menu } from './menu.model'

@Table
export class Action extends Model {
  @Column({ type: DataTypes.STRING, allowNull: false, comment: "标识" })
  handleCode: string;

  @Column({ type: DataTypes.STRING, allowNull: false, comment: "名称" })
  name: string;

  @Column({ type: DataTypes.INTEGER, defaultValue: 0, comment: "排序" })
  weight: number;

  @ForeignKey(() => Menu)
  @Column({ type: DataTypes.STRING, comment: "菜单moduleId" })
  moduleId: string;

  @Column({ type: DataTypes.STRING, comment: "模型Id" })
  modelId: string;

  @Column({ type: DataTypes.STRING, comment: "背景色" })
  bgColor: string;

  @Column({ type: DataTypes.STRING, comment: "图标" })
  bindImg: string;

  @Column({ type: DataTypes.STRING, comment: "数据模型Id" })
  dataModelId: string;

  @Column({ type: DataTypes.INTEGER, comment: "操作类型" })
  handleType: number;

  @Column({ type: DataTypes.STRING, comment: "链接" })
  href: string;

  @Column({ type: DataTypes.STRING, comment: "模型类型" })
  modelClassify: string;

  @Column({ type: DataTypes.INTEGER, comment: "排序" })
  handleOrder: number;

  @Column({ type: DataTypes.INTEGER, comment: "客户端类型" })
  client: number;

  @Column({ type: DataTypes.STRING, comment: "父级Id" })
  parentId: string;

  @Column({ type: DataTypes.STRING, comment: "统计" })
  summary: string;

  @Column({ type: DataTypes.STRING, comment: "部门Id" })
  deptId: string;

  @Column({ type: DataTypes.STRING, comment: "标题" })
  title: string;

  @Column({ type: DataTypes.INTEGER, comment: "工艺模版Id" })
  workflowTemplateId: number;
}
